#include "gtest/gtest.h"

int func(){
    int *ptr = NULL;
    *ptr=100;
    return 0;    
}

TEST(FuncDeathTest, nullptr)
{
    ASSERT_DEATH(func(), "");
}

TEST(FuncDeathTest, exitDemo)
{
    EXPECT_EXIT(_exit(1),  testing::ExitedWithCode(1),  "");
}
/*
TEST(FuncDeathTest, exitDemo2)
{
    EXPECT_EXIT(func(),  testing::ExitedWithCode(1),  "");
}
*/
